package com.ruoyi.reserve.service.impl;

import com.ruoyi.reserve.domain.OrderSetting;
import com.ruoyi.reserve.mapper.OrderSettingMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class OrderSettingServiceImpl implements IOrderSettingService{

    @Autowired
    private OrderSettingMapper orderSettingMapper;

    /**
     * 通过日期查询当天的预约上限与已预约人数
     * @param orderDate
     * @return
     */
    @Override
    public OrderSetting selectOrderSetting(String orderDate) {
        return orderSettingMapper.selectOrderSetting(orderDate);
    }

    /**
     * 查询全部预约设置
     * @param orderSetting
     * @return
     */
    @Override
    public List<OrderSetting> selectOrderSettingList(OrderSetting orderSetting) {
        return orderSettingMapper.selectOrderSettingList(orderSetting);
    }

    /**
     * 修改预约上限
     * @param orderSetting
     * @return
     */
    @Override
    public int updateOrderSetting(OrderSetting orderSetting) {
        return orderSettingMapper.updateOrderSetting(orderSetting);
    }

    /**
     * 新增预约上限
     * @param orderSetting
     * @return
     */
    @Override
    public int insertOrderSetting(OrderSetting orderSetting) {
        return orderSettingMapper.insertOrderSetting(orderSetting);
    }
}
